import 'package:flutter/material.dart';

class EgRouterTest extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("测试路由导航"),
      ),
      body: new Center(
        child: RaisedButton(
          onPressed: () {
            Navigator.push(context, new MaterialPageRoute(builder: (context) => new EgRouterTest2()));
          },
          child: new Text("按下去第二页"),
        ),
      ),
    );
  }
}

class EgRouterTest2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("准备返回"),
      ),
      body: new Center(
        child: RaisedButton(
          onPressed: () {
            Navigator.pop(context);
          },
          child: new Text("返回第一页"),
        ),
      ),
    );
  }
}
